package net.lainiao.morethread.Chapter3.demo1;

/**
 * Created by Administrator on 2017/3/1.
 */
public class Job implements Runnable {
    private PrintQueue printQueue;

    public Job(PrintQueue printQueue) {
        this.printQueue = printQueue;
    }

    @Override
    public void run() {
        System.out.printf("%s:Going to print a Job\n",Thread.currentThread().getName());
        printQueue.printJob(new Object());
        System.out.printf("%s:The document has been printed \n",Thread.currentThread().getName());
    }
}
